package resoft.jeasyform.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * <p></p>
 * User: albert
 * Date: Aug 27, 2007
 * Time: 2:39:48 AM
 */
public class ClassUtil {
    private static final Log logger = LogFactory.getLog(ClassUtil.class);

    public static Object newInstance(String className) {
        if(className==null || className.equals("")) {
            return null;
        }
        try {
            return Class.forName(className).newInstance();
        } catch (Exception e) {
            logger.error("load class error:" + className,e);
        }
        return null;
    }
}
